package bai5.view;

import java.text.ParseException;
import java.util.InputMismatchException;
import java.util.Scanner;

import bai5.model.Configuration;
import bai5.model.Employee;
import bai5.model.Materials;
import bai5.model.Position;
import bai5.model.Profile;
import bai5.model.Project;
import bai5.model.Salary;
import bai5.model.Technology;
import bai5.model.Timesheet;

public class Run {
	public static void main(String args[]) throws ParseException{
		Employee emp=new Employee();
		Project pj=new Project();
		Timesheet ts=new Timesheet();
		Profile pf=new Profile();
		Salary sl=new Salary();
		Materials mr=new Materials();
		Position ps=new Position();
		Technology tn=new Technology();
		Configuration cf=new Configuration();
		Scanner ip=new Scanner(System.in);
		int chon=1;
		do{
			System.out.println("====================Menu====================");
			System.out.println("1) Nhap vao Employee.In thong tin Employee");
			System.out.println("2) Nhap vao Project.In thong tin Project");
			System.out.println("3) Nhap vao Timesheet.In thong tin Timesheet");
			System.out.println("4) Nhap vao Profile.In thong tin Profile");
			System.out.println("5) Nhap vao Salary.In thong tin Salary");
			System.out.println("6) Nhap vao Materials.In thong tin Materials");
			System.out.println("7) Nhap vao Position.In thong tin Position");
			System.out.println("8) Nhap vao Technology.In thong tin Technology");
			System.out.println("9) Nhap vao Configuration.In thong tin Configuration");
			System.out.println("10) Thoat. ");
			try{
				chon=ip.nextInt();
			}catch(InputMismatchException e){
				System.out.println("Nhap sai dinh dang");
			}
			switch(chon){
			case 1:{
				emp.display(emp.inputEmployee());
				break;
			}
			case 2:{
				pj.display(pj.inputProject());
				break;
			}
			case 3:{
				ts.display(ts.inputTimesheet());
				break;
			}
			case 4:{
				pf.display(pf.inputProfile());
				break;
			}case 5:{
				sl.display(sl.inputSalary());
				break;
			}case 6:{
				mr.display(mr.inputMaterials());
				break;
			}case 7:{
				ps.display(ps.inputPosition());
				break;
			}case 8:{
				tn.display(tn.inputTechnology());
			}case 9:{
				cf.display(cf.inputConfiguration());
				break;
			}case 10:{
				break;
			}
			default:
				System.out.println("Nhap sai vui long nhap lai");
			}
		}
		while(chon!=0);
	}		
	

}
